package com.chinasofti.mydate;

import java.util.Date;

public class DateDemo2 {
    public static void main(String[] args) {
        //method1();//ctrl + alt + m  选择代码进行重构，变为方法并在main方法中使用
        method2();
    }

    private static void method2() {
        Date date1 = new Date();
        date1.setTime(0L);
        System.out.println("date1 = " + date1);
    }

    private static void method1() {
        Date date1 = new Date();
        long time = date1.getTime();//获取当前时间的毫秒值
        System.out.println("time = " + time);

        long time2 = System.currentTimeMillis();
        System.out.println("time2 = " + time2);
    }
}
